package com.deyuanyun.pic.ae.controller.vo;

import com.deyuanyun.pic.ae.domain.SpecificPlace;
import com.deyuanyun.pic.ae.domain.TrafficFacilities;
import com.deyuanyun.pic.pipe.controller.vo.BaseVOUtil;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;
import com.deyuanyun.pic.settings.support.biz.PipeLineUtil;
import com.github.pagehelper.Page;

import java.math.BigDecimal;
import java.util.Date;

/**
 * “沿线特定场所” 查询展示对象
 *
 * 方法详情：<br/>
 *
 * @author huanglw
 * @date  2016-11-11
 *
 * History: [修改人][时间][修改描述]
 */
public class SpecificPlaceVO extends AEBaseVO<SpecificPlace>{

    // 管道名称
    private String pipeLineName;
    // 名称
    private String name;
    // 类别AESEWER_CATEGORY（特定场所Ⅰ、特定场所Ⅱ）
    private String category;
    // 类型AESEWER_TYPE（医院、学校、托儿所、幼儿园、养老院、监狱、商场、集贸市场、寺庙、运动场、广场、娱乐休闲地、剧院、露营地、其它）
    private String type;
    // 与管道最小间距（m）
    private BigDecimal minDistance;
    // 位置描述
    private String locationDescription;
    // 人口数量
    private Long population;

    // 数据状态
    private String dataStated;
    private String gisid;

    public String getPipeLineName() {
        return pipeLineName;
    }

    public void setPipeLineName(String pipeLineName) {
        this.pipeLineName = pipeLineName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigDecimal getMinDistance() {
        return minDistance;
    }

    public void setMinDistance(BigDecimal minDistance) {
        this.minDistance = minDistance;
    }

    public String getLocationDescription() {
        return locationDescription;
    }

    public void setLocationDescription(String locationDescription) {
        this.locationDescription = locationDescription;
    }

    public Long getPopulation() {
        return population;
    }

    public void setPopulation(Long population) {
        this.population = population;
    }

    public String getDataStated() {
        return dataStated;
    }

    public void setDataStated(String dataStated) {
        this.dataStated = dataStated;
    }

    public String getGisid() {
        return gisid;
    }

    public void setGisid(String gisid) {
        this.gisid = gisid;
    }

    @Override
    public void fromDomain(SpecificPlace domain) {

        // 管道名称
        this.pipeLineName = PipeLineUtil.getPipeLineName(domain.getPipeLineId());
        // 名称
        this.name = domain.getName();
        // 类别AESEWER_CATEGORY（特定场所Ⅰ、特定场所Ⅱ）
        this.category = CodeUtil.getName(domain.getCategory());
        // 类型AESEWER_TYPE（医院、学校、托儿所、幼儿园、养老院、监狱、商场、集贸市场、寺庙、运动场、广场、娱乐休闲地、剧院、露营地、其它）
        this.type = CodeUtil.getName(domain.getType());
        // 与管道最小间距（m）
        this.minDistance = domain.getMinDistance();
        // 位置描述
        this.locationDescription = domain.getLocationDescription();
        // 人口数量
        this.population = domain.getPopulation();
        // 数据状态
        this.dataStated = domain.getDataStated();
        this.gisid = domain.getGisid();

        super.fromDomain(domain.getId(), domain.getRecorder(), domain.getRecordTime(), domain.getRemarks());
    }

    public Page<SpecificPlaceVO> fromDomainList(Page<SpecificPlace> domainList) {
        Page<SpecificPlaceVO> list = new Page<SpecificPlaceVO>();
        for (SpecificPlace specificPlace : domainList) {
            SpecificPlaceVO specificPlaceVO = new SpecificPlaceVO();
            specificPlaceVO.fromDomain(specificPlace);
            list.add(specificPlaceVO);
        }
        BaseVOUtil.converterPage(domainList, list);
        return list;
    }
}